All Questions
Tagged with cssblock-editor
76 questions
0votes
0answers
7views
CSS Selector to override default theme.json custom properties in theme stylesheet
I need to specify some more finicky media query driven styles to override theme.json's default custom properties. Abbreviated example below. This example works, however I don't like that I have to use ...
0votes
1answer
23views
grid overlapping problem
I wanted to see if this layout ( https://gridbyexample.com/examples/example22/ ) in wordpress gutenberg because I need this "trick" in a layout where I work on. But to my surprise I see ...
0votes
0answers
101views
Style priority in theme.json
I have the following theme.json file in a custom classic/hybrid theme: theme.json file: "styles": { "elements": { "heading": { "color": {...
0votes
0answers
72views
How do I highlight a Wordpress Menu Item for a page that is not on the Menu?
I am writing a Wordpress site using the block editor (Spectra One theme). I have a menu item called News. When I click on it the News page appears and the News menu item is highlighted. The News page ...
2votes
0answers
52views
Block style variations not enqueued for blocks inside HTML code dynamically rendered via JS
The new WP 6.6 will let anyone style any registered block style variations in theme.json via the styles.blocks.blockName.variations property. Check the following post for more info: https://developer....
0votes
0answers
76views
How to add a class to a core block in both admin editor and frontend?
I'm having huge difficulties with the forced styling bundled in WP (using hybrid themes): body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) { max-width: ...
1vote
1answer
205views
Get generated block styles programmatically
If you use wp_head() in the header of your theme Wordpress generated a style tag for the Gutenberg block editor. Who knows how you can get the generated css style tag with the styles without using ...
1vote
1answer
71views
Block editor: can’t change format of inline code blocks
I’ve just to moved an old Movable Type 5 blog over to wordpress, and the process was relatively straightforward. But now I am trying to tweak the styles of my site. (For what it’s worth, this is using ...
0votes
0answers
173views
How to force Gutenberg to follow all custom CSS styling in preview?
I noticed that the live website version can often be different to preview in Gutenberg. For example, this CSS is added as additional/custom CSS through Styles menu: .no-link-underline:link { text-...
1vote
0answers
80views
Load RTL CSS using block.json for block development
I am developing a block using block.json and I could load RTL CSS on backend using this code: // Check if RTL mode is enabled if (wp.i18n.isRTL()) { // Import RTL stylesheet if RTL mode is enabled ...
1vote
0answers
105views
Gutenberg inline style messing up the navigation when I add a list to a page
This is sort of weird. I have a set of pages and the navigation looks the same on all but one page. After trial/error I was able to narrow it down to having a list on my page. As soon as I add a list ...
0votes
1answer
701views
Enqueue Stylesheet on the front end and in the block editor Conditionally
How would you include a stylesheet in both the block-editor and on the front-end if the page meets certain criteria? In this case I want to include a stylesheet called homepage.css if the page is the ...
0votes
1answer
173views
Turn off/modify specific pre-rendered Gutenberg editor CSS styles
I'm having an issue where Gutenberg is pre-rendering with the theme's style.css, and some of the styles are not fit for the editor. Specifically, I have a class that utilizes transform: translate ...
1vote
1answer
501views
Embed dynamic media query in a Gutenberg block
I'm working on a custom block that renders a series of DIVs differently depending on the device on which it is displayed. On desktop, the DIVs need to be displayed horizontally with a right margin of ...
0votes
3answers
3kviews
How to remove class="wp-block-heading" from Heading tags?
WordPress is injecting class="wp-block-heading" to all the heading tags, like h1, h2, and h3. Even though I don't need it in my style sheet. I tried removing it with the following codes, but ...